/******************************************************************************
 * 版本                      修订内容
 *
 * v1.0.0                    initial version
 *
 * v1.0.1                    消除顶部白线
 *
 ******************************************************************************/
SGKS_VI_SensorDrvCfgT jxh42_drvcfg_info =
{

/*
 **********************************************************
 * Part Header
 **********************************************************
 */
    .HeaerPart =
    {
        .version      = SGKS_SENSOR_SDRVCFG_VERSION,
        .version_info = "v1.0.1",
        .length       = sizeof(SGKS_VI_SensorDrvCfgT),
        .file_date    = 0x18040418,
        .debug_print  = 0,
    },

/*
 **********************************************************
 * Part HwInfo
 **********************************************************
 */
    .HwInfoPart =
    {
        .dev_num    = 1,
        .DevInfo[0] =
        {
            .name      = "jxh42",
            .ctl_type  = SGKS_SENSOR_CTL_I2C,
            .hw_addr   = {0x60, 0x6c, 0x68, 0x64},
            .addr_len  = sizeof(u8),
            .data_len  = sizeof(u8),
            .reset_reg =
            {
                {0x12, 0x80, 0x80},
                {SGKS_VI_SENSOR_TABLE_FLAG_MSLEEP, 5},
                {0x12, 0x00, 0x80},
                {SGKS_VI_SENSOR_TABLE_FLAG_END,},
            },
            .id_reg =
            {
                {0x0A},
                {0x0B},
                {SGKS_VI_SENSOR_TABLE_FLAG_END,},
            },
            .id = 0xA042,

            .reset_active_level     = SGKS_GPIO_LOW,
            .reset_gpio             = 6,//SGKS_GPIO_SKIP,
            .reset_delay            = 20,
            .powerdown_active_level = SGKS_GPIO_HIGH,
            .powerdown_gpio         = 27,
            .powerdown_delay        = 20,
        },

        .DevInfo[1] =
        {
            0,
        },
    },

/*
 **********************************************************
 * Part Init reg
 **********************************************************
 */
    .InitPart =
    {
        .init_order  =
        {
            [SGKS_SENSOR_INPUT_INTERFACE_MIPI] =
            {
                INIT_ORDER_REG00,
                INIT_ORDER_MIPI_STAGE1,
                INIT_ORDER_REG01,
                INIT_ORDER_MIPI_STAGE2,

                INIT_ORDER_END,
            },

            [SGKS_SENSOR_INPUT_INTERFACE_DVP] =
            {
                INIT_ORDER_REG02,

                INIT_ORDER_END,
            },
        },

        //dev[0]
        .init_reg[0] =
        {
            .reg[0] =
            {
                {0x12, 0x40},
                {0x0D, 0x40},
                {0x1F, 0x04},
                {0x0E, 0x1D},
                {0x0F, 0x09},
                {0x10, 0x1E},
                {0x11, 0x80},
                {0x20, 0x40},
                {0x21, 0x06},
                {0x22, 0x84},
                {0x23, 0x03},
                {0x24, 0x00},
                {0x25, 0xD4},
                {0x26, 0x25},
                {0x27, 0x3B},
                {0x28, 0x0B},
                {0x29, 0x01},
                {0x2A, 0x24},
                {0x2B, 0x29},
                {0x2C, 0x03},
                {0x2D, 0x01},
                {0x2E, 0xB8},
                {0x2F, 0x00},
                {0x30, 0x92},
                {0x31, 0x0A},
                {0x32, 0xAA},
                {0x33, 0x14},
                {0x34, 0x38},
                {0x35, 0x54},
                {0x42, 0x41},
                {0x43, 0x40},
                {0x1D, 0x00},
                {0x1E, 0x00},
                {0x6C, 0x50},
                {0x73, 0x33},
                {0x70, 0x68},
                {0x76, 0x40},
                {0x77, 0x06},
                {0x78, 0x1F},
                {0x71, 0x4A},
                {0x72, 0x48},
                {0x6D, 0xA2},
                {0x48, 0x40},
                {0x60, 0xA4},
                {0x61, 0xFF},
                {0x62, 0x40},
                {0x65, 0x00},
                {0x66, 0x20},
                {0x67, 0x30},
                {0x68, 0x04},
                {0x69, 0x74},
                {0x6F, 0x24},
                {0x63, 0x51},
                {0x6A, 0x09},
                {0x13, 0x87},
                {0x14, 0x80},
                {0x16, 0xC0},
                {0x17, 0x40},
                {0x18, 0xE1},
                {0x38, 0x35},
                {0x39, 0x98},
                {0x4a, 0x03},
                {0x49, 0x10},

                {0x74, 0x53}, // gate clk:0x13
                {SGKS_VI_SENSOR_TABLE_FLAG_END,}
            },

            .reg[1] =
            {
                {0x12, 0x00},
                {SGKS_VI_SENSOR_TABLE_FLAG_END,}
            },

            .reg[2] =
            {
                {0x0C, 0x40},  // 0x00
                       
                {0x0D, 0x5C},  // 0x40
                {0x1F, 0x04},  // 0x1F
                {0x2A, 0x24},
                {0x2B, 0x29},
                {0x2C, 0x04},  // 0x2C 03
                {0x2D, 0x00},  // 0x2D 0x000=0
                {0x2E, 0xB9},  // 0x2E 0x0B9=185
                {0x2F, 0x00},  // 0x2F
                // Sensor Timing
                {0x30, 0x92},
                {0x31, 0x0A},
                {0x32, 0xAA},
                {0x33, 0x14},
                {0x34, 0x38},
                {0x35, 0x54},
                {0x42, 0x41},
                {0x43, 0x50}, //40
                // Interface
                {0x1D, 0xFF},  // 0x1D port D[7:0] GPIO out
                //{JXH42_DVP4,      0x9B},  // 0x1E PCLK HREF VSYNC PCLK HREF VSYNC port D[9:8] GPIO out
                {0x1E, 0x9F},  // 0x1E PCLK HREF VSYNC PCLK HREF VSYNC port D[9:8] GPIO out
                {0x6C, 0x90},
                {0x73, 0xB3},
                {0x70, 0x68},
                {0x76, 0x40},
                {0x77, 0x06},
                // Array/AnADC/PWC
                {0x48, 0x40},
                {0x60, 0xA4},
                {0x61, 0xFF},
                {0x62, 0x40},
                {0x65, 0x00},
                {0x66, 0x20},
                {0x67, 0x30},
                {0x68, 0x04},
                {0x69, 0x74},
                {0x6F, 0x04},
                // Black Sun
                {0x63, 0x51},
                {0x6A, 0x09},
                // AE/AG/ABLC
                {0x13,  0x87},  // 0x13 Gain ceiling 100: 32x
                {0x14,  0x80},  // 0x14
                {0x16,  0xC0},  // 0x16
                {0x17,  0x40},  // 0x17
                {0x18,  0xBB},  // 0x18
                {0x38,  0x35},  // 0x38
                {0x39,  0x98},  // 0x39
                {0x4A,  0x03},  // 0x4A
                {0x49,  0x04},  // 0x49

                {SGKS_VI_SENSOR_TABLE_FLAG_END,}
            },

            .reg[3] =
            {
                {SGKS_VI_SENSOR_TABLE_FLAG_END,}
            },

            .dma_ex_reg =
            {
                {SGKS_VI_SENSOR_TABLE_FLAG_END,}
            },

            .mipi_ex_reg =
            {
                {SGKS_VI_SENSOR_TABLE_FLAG_END,}
            },
        },

        //dev[1]
        .init_reg[1]  =
        {
            0,
        },
    },

/*
 **********************************************************
 * Part vin setting
 **********************************************************
 */
    .VinPart =
    {
        .input_format       = SGKS_VI_INPUT_FORMAT_RGB_RAW,
        .field_format       = 1,
        .adapter_id         = 0,
        .sensor_id          = SGKS_VI_SENSOR_JXH42,
        .sensor_double_step = 20,
        .typeofsensor       = 1,
        .sync_time_delay    = 40,

        .source_type.dummy  = SGKS_VI_CMOS_CHANNEL_TYPE_AUTO,
        .dev_type           = SGKS_VI_DEV_TYPE_CMOS,

        .video_system       = SGKS_VI_VIDEO_SYSTEM_AUTO,
        .vs_polarity        = SGKS_VI_RISING_EDGE,
        .hs_polarity        = SGKS_VI_RISING_EDGE,
        .data_edge          = SGKS_VI_RISING_EDGE,

        .emb_sync_switch    = SGKS_VI_EMB_SYNC_OFF,
        .emb_sync_loc       = SGKS_VI_EMB_SYNC_LOWER_PEL,
        .emb_sync_mode      = SGKS_VI_EMB_SYNC_FULL_RANGE,
        .input_mode         = SGKS_VI_INPUT_MODE4(RGB,1PEL,SDR,LVCMOS),

        .input_data_width   = SGKS_VI_INPUT_DATA_10BIT,

        .max_width          = 1280,
        .max_height         = 728,
    },

/*
 **********************************************************
 * Part interface
 **********************************************************
 */
    .InterfacePart =
    {
        .interface_type = SGKS_SENSOR_INPUT_INTERFACE_MIPI,
        .input_type     = SGKS_SENSOR_INPUT_TYPE_VIN,
        .interface_regs =
        {
            [SGKS_SENSOR_INPUT_INTERFACE_MIPI] =
            {
                {SGKS_VI_SENSOR_TABLE_FLAG_END,},
            },
            [SGKS_SENSOR_INPUT_INTERFACE_DVP] =
            {
                {SGKS_VI_SENSOR_TABLE_FLAG_END,},
            },
        },

        .mipi_lanes_regs =
        {
            [MIPI_CSI_ACTIVE_LANE_1] =
            {
                {SGKS_VI_SENSOR_TABLE_FLAG_END,},
            },
            [MIPI_CSI_ACTIVE_LANE_2] =
            {
                {SGKS_VI_SENSOR_TABLE_FLAG_END,},
            },
             [MIPI_CSI_ACTIVE_LANE_3] =
            {
                {SGKS_VI_SENSOR_TABLE_FLAG_END,},
            },
            [MIPI_CSI_ACTIVE_LANE_4] =
            {
                {SGKS_VI_SENSOR_TABLE_FLAG_END,},
            },
        },

        .mipi_csi_config =
        {
            [0] =
            {
                .config =
                {
                    .ipi_vcid            = 0,
                    .mipi_lanes          = MIPI_CSI_ACTIVE_LANE_1,
                    .dphy_freq_range     = MIPI_CSI_DPHY_FREQ_200_210Mbps,
                    .ipi_color_mode_bits = MIPI_CSI_IPI_COLOR_MODE_16BITS,
                    .ipi_mode            = MIPI_CSI_IPI_MODE_CAMERA_TIMING,
                    .ipi_data_type       = MIPI_CSI_IPI_DATA_TYPE_RAW10,

                    .video_hsa_time      = 20,
                    .video_hbp_time      = 200,
                    .video_hsd_time      = 12,
                    .video_hline_time    = 0,
                    .video_vsa_lines     = 2,
                    .video_vbp_lines     = 6,
                    .video_vfp_lines     = 8,
                    .video_vactive_lines = 720,
                },
                .mipi_timming2 = 0xffff,
            },

            [1] =
            {
                .config =
                {
                    .ipi_vcid            = 0,
                    .mipi_lanes          = MIPI_CSI_ACTIVE_LANE_2,
                    .dphy_freq_range     = MIPI_CSI_DPHY_FREQ_450_500Mbps,
                    .ipi_color_mode_bits = MIPI_CSI_IPI_COLOR_MODE_16BITS,
                    .ipi_mode            = MIPI_CSI_IPI_MODE_CONTROLLER_TIMING,
                    .ipi_data_type       = MIPI_CSI_IPI_DATA_TYPE_RAW10,

                    //.video_hsa_time      = 260,
                    //.video_hbp_time      = 16,
                    //.video_hsd_time      = 16*118,
                    //.video_hline_time    = 36*150-67,

                    .video_hsa_time      = 270,
                    .video_hbp_time      = 16,
                    .video_hsd_time      = 16*118,
                    .video_hline_time    = 36*150-67,

                    .video_vsa_lines     = 0,
                    .video_vbp_lines     = 0,
                    .video_vfp_lines     = 0,
                    .video_vactive_lines = 1088,
                },
                .mipi_timming2 = 0xffff,
            },
        },
    },

/*
 **********************************************************
 * Part Pll setting
 **********************************************************
 */
    .PllPart =
    {
        .pll_table[SGKS_SENSOR_INPUT_INTERFACE_MIPI] =
        {
            [0] =
            {
                .pixclk = 36000000,
                .extclk = 24000000,
                .regs =
                {
                    {0x0E, 0x1D},
                    {0x0F, 0x09},
                    {0x10, 0x1e},
                    {0x11, 0x80},

                    {SGKS_VI_SENSOR_TABLE_FLAG_END,}
                }
            },
        },

        .pll_table[SGKS_SENSOR_INPUT_INTERFACE_DVP] =
        {
            [0] =
            {
                .pixclk = 36000000,
                .extclk = 27000000,
                .regs =
                {
                    {0x0E, 0x1D},   
                    {0x0F, 0x08},      
                    {0x10, 0x18},
                    {0x11, 0x80},

                    {SGKS_VI_SENSOR_TABLE_FLAG_END,}
                }
            },
        },

    },

/*
 **********************************************************
 * Part video fomats
 **********************************************************
 */
    .VideoFmtPart =
    {
        .fmt_num  = 2,
        .auto_fmt = SGKS_VIDEO_MODE(1280,  720,  25, 0),

        .VideoFmtInfo =
        {
            [SGKS_SENSOR_INPUT_INTERFACE_MIPI] =
            {
                [0] = // 1280x720P@30fps
                {
                    .video_mode_table =
                    {
                        .mode              = SGKS_VIDEO_MODE(1280, 720,  30, 0),
                        .preview_mode_type = SGKS_VI_SRC_ENABLED_FOR_VIDEO | SGKS_VI_SRC_ENABLED_FOR_STILL,
                        .still_mode_type   = SGKS_VI_SRC_ENABLED_FOR_VIDEO | SGKS_VI_SRC_ENABLED_FOR_STILL,
                    },
                    .fmt_reg =
                    {
                        {0x20, 0x40},
                        {0x21, 0x06},
                        {0x22, 0xEE},
                        {0x23, 0x02},
                        {0x27, 0x3D},
                        {0x28, 0x0D},
                        {0x29, 0x01},
                        {0x24, 0x00},
                        {0x25, 0xD0},
                        {0x26, 0x25},
                        {0x18, 0xBB},
                        {SGKS_VI_SENSOR_TABLE_FLAG_END,},
                    },
                    .vi_info =
                    {
                        .width        = 1280,
                        .height       = 720,
                        .format       = SGKS_VIDEO_FORMAT_PROGRESSIVE,
                        .type         = SGKS_VIDEO_TYPE_RGB_RAW,
                        .bits         = SGKS_VIDEO_BITS_10,
                        .ratio        = SGKS_VIDEO_RATIO_16_9,
                        .srm          = 0,
                        .pll_index    = 0,
                        .mipi_index   = 0,
                        .max_fps      = SGKS_VIDEO_FPS(30),
                        .min_fps      = SGKS_VIDEO_FPS(1),
                        .auto_fps     = SGKS_VIDEO_FPS(30),
                        .dgain_type   = SGKS_ISP_TUNNING_DATA_AE_SHT_DGAIN_1080P_30,
                    },
                    .video_info_table =
                    {
                        .def_start_x    = 0,
                        .def_start_y    = 0,
                        .def_width      = 1280,
                        .def_height     = 720,
                        .sync_start     = 0,
                        .bayer_pattern  = SGKS_VI_BAYER_PATTERN_GR,
                        .mirror_bayer_pattern =
                        {
                            SGKS_VI_BAYER_PATTERN_GB,
                            SGKS_VI_BAYER_PATTERN_RG,
                            SGKS_VI_BAYER_PATTERN_BG,
                            SGKS_VI_BAYER_PATTERN_GR,
                        },
                    },
                    .update_after_vsync_start   = 3,
                    .update_after_vsync_end     = 10,
                },

                [1] = // 1280x720P@25fps
                {
                    .video_mode_table =
                    {
                        .mode              = SGKS_VIDEO_MODE(1280, 720,  25, 0),
                        .preview_mode_type = SGKS_VI_SRC_ENABLED_FOR_VIDEO | SGKS_VI_SRC_ENABLED_FOR_STILL,
                        .still_mode_type   = SGKS_VI_SRC_ENABLED_FOR_VIDEO | SGKS_VI_SRC_ENABLED_FOR_STILL,
                    },
                    .fmt_reg =
                    {
                        {0x20, 0x40},
                        {0x21, 0x06},
                        {0x22, 0x84},
                        {0x23, 0x03},
                        {0x27, 0x3B},
                        {0x28, 0x0B},
                        {0x29, 0x01},
                        {0x24, 0x00},
                        {0x25, 0xD4},
                        {0x26, 0x25},
                        {0x18, 0xE1},
                        {SGKS_VI_SENSOR_TABLE_FLAG_END,},
                    },
                    .vi_info =
                    {
                        .width        = 1280,
                        .height       = 720,
                        .format       = SGKS_VIDEO_FORMAT_PROGRESSIVE,
                        .type         = SGKS_VIDEO_TYPE_RGB_RAW,
                        .bits         = SGKS_VIDEO_BITS_10,
                        .ratio        = SGKS_VIDEO_RATIO_16_9,
                        .srm          = 0,
                        .pll_index    = 0,
                        .mipi_index   = 0,
                        .max_fps      = SGKS_VIDEO_FPS(25),
                        .min_fps      = SGKS_VIDEO_FPS(1),
                        .auto_fps     = SGKS_VIDEO_FPS(25),
                        .dgain_type   = SGKS_ISP_TUNNING_DATA_AE_SHT_DGAIN_720P_25,
                    },
                    .video_info_table =
                    {
                        .def_start_x    = 0,
                        .def_start_y    = 2,
                        .def_width      = 1280,
                        .def_height     = 720,
                        .sync_start     = 0,
                        .bayer_pattern  = SGKS_VI_BAYER_PATTERN_GR,
                        .mirror_bayer_pattern =
                        {
                            SGKS_VI_BAYER_PATTERN_GB,
                            SGKS_VI_BAYER_PATTERN_RG,
                            SGKS_VI_BAYER_PATTERN_BG,
                            SGKS_VI_BAYER_PATTERN_GR,
                        },
                    },
                    .update_after_vsync_start   = 3,
                    .update_after_vsync_end     = 10,
                },
            },

            [SGKS_SENSOR_INPUT_INTERFACE_DVP] =
            {
                [0] = // 1280x720P@30fps
                {
                    .video_mode_table =
                    {
                        .mode              = SGKS_VIDEO_MODE(1280, 720,  30, 0),
                        .preview_mode_type = SGKS_VI_SRC_ENABLED_FOR_VIDEO | SGKS_VI_SRC_ENABLED_FOR_STILL,
                        .still_mode_type   = SGKS_VI_SRC_ENABLED_FOR_VIDEO | SGKS_VI_SRC_ENABLED_FOR_STILL,
                    },
                    .fmt_reg =
                    {
                        {0x20, 0x40},
                        {0x21, 0x06},
                        {0x22, 0xEE},
                        {0x23, 0x02},
                        {0x27, 0x3D},
                        {0x28, 0x0D},
                        {0x29, 0x01},
                        {0x24, 0x00},
                        {0x25, 0xD0},
                        {0x26, 0x25},
                        {0x18, 0xBB},

                        {SGKS_VI_SENSOR_TABLE_FLAG_END,},
                    },
                    .vi_info =
                    {
                        .width        = 1280,
                        .height       = 720,
                        .format       = SGKS_VIDEO_FORMAT_PROGRESSIVE,
                        .type         = SGKS_VIDEO_TYPE_RGB_RAW,
                        .bits         = SGKS_VIDEO_BITS_10,
                        .ratio        = SGKS_VIDEO_RATIO_16_9,
                        .srm          = 0,
                        .pll_index    = 0,
                        .mipi_index   = 0,
                        .max_fps      = SGKS_VIDEO_FPS(30),
                        .min_fps      = SGKS_VIDEO_FPS(1),
                        .auto_fps     = SGKS_VIDEO_FPS(30),
                        .dgain_type   = SGKS_ISP_TUNNING_DATA_AE_SHT_DGAIN_1080P_30,
                    },
                    .video_info_table =
                    {
                        .def_start_x    = 0,
                        .def_start_y    = 0,
                        .def_width      = 1280,
                        .def_height     = 720,
                        .sync_start     = 0,
                        .bayer_pattern  = SGKS_VI_BAYER_PATTERN_GR,
                        .mirror_bayer_pattern =
                        {
                            SGKS_VI_BAYER_PATTERN_RG,
                            SGKS_VI_BAYER_PATTERN_GB,
                            SGKS_VI_BAYER_PATTERN_GR,
                            SGKS_VI_BAYER_PATTERN_BG,
                        },
                    },
                    .update_after_vsync_start   = 3,
                    .update_after_vsync_end     = 10,
                },

                [1] = // 1280x720P@25fps
                {
                    .video_mode_table =
                    {
                        .mode              = SGKS_VIDEO_MODE(1280, 720,  25, 0),
                        .preview_mode_type = SGKS_VI_SRC_ENABLED_FOR_VIDEO | SGKS_VI_SRC_ENABLED_FOR_STILL,
                        .still_mode_type   = SGKS_VI_SRC_ENABLED_FOR_VIDEO | SGKS_VI_SRC_ENABLED_FOR_STILL,
                    },
                    .fmt_reg =
                    {
                        {0x20, 0x40},
                        {0x21, 0x06},
                        {0x22, 0x84},
                        {0x23, 0x03},
                        {0x27, 0x3D},
                        {0x28, 0x0D},
                        {0x29, 0x01},
                        {0x24, 0x00},
                        {0x25, 0xD0},
                        {0x26, 0x25},
                        {0x18, 0xBB},

                        {SGKS_VI_SENSOR_TABLE_FLAG_END,},
                    },
                    .vi_info =
                    {
                        .width        = 1280,
                        .height       = 720,
                        .format       = SGKS_VIDEO_FORMAT_PROGRESSIVE,
                        .type         = SGKS_VIDEO_TYPE_RGB_RAW,
                        .bits         = SGKS_VIDEO_BITS_10,
                        .ratio        = SGKS_VIDEO_RATIO_16_9,
                        .srm          = 0,
                        .pll_index    = 0,
                        .mipi_index   = 0,
                        .max_fps      = SGKS_VIDEO_FPS(25),
                        .min_fps      = SGKS_VIDEO_FPS(1),
                        .auto_fps     = SGKS_VIDEO_FPS(25),
                        .dgain_type   = SGKS_ISP_TUNNING_DATA_AE_SHT_DGAIN_1080P_30,
                    },
                    .video_info_table =
                    {
                        .def_start_x    = 0,
                        .def_start_y    = 0,
                        .def_width      = 1280,
                        .def_height     = 720,
                        .sync_start     = 0,
                        .bayer_pattern  = SGKS_VI_BAYER_PATTERN_GR,
                        .mirror_bayer_pattern =
                        {
                            SGKS_VI_BAYER_PATTERN_RG,
                            SGKS_VI_BAYER_PATTERN_GB,
                            SGKS_VI_BAYER_PATTERN_GR,
                            SGKS_VI_BAYER_PATTERN_BG,
                        },
                    },
                    .update_after_vsync_start   = 3,
                    .update_after_vsync_end     = 10,
                },
            },
        },
    },

/*
 **********************************************************
 * Part mirror
 **********************************************************
 */
    .MirrorPart =
    {
        .mirror_reg_update_mode     = SGKS_SENSOR_UPDATE_REG_BY_SET,
#define JXH42_V_FLIP    (1<<4)
#define JXH42_H_MIRROR  (1<<5)
        .mirror_table =
        {
            [SGKS_VI_SRC_MIRROR_HORRIZONTALLY_VERTICALLY] =
            {
                {0x12, JXH42_H_MIRROR | JXH42_V_FLIP, JXH42_H_MIRROR | JXH42_V_FLIP},
                {SGKS_VI_SENSOR_TABLE_FLAG_END,},
            },
            [SGKS_VI_SRC_MIRROR_HORRIZONTALLY] =
            {
                {0x12, JXH42_H_MIRROR, JXH42_H_MIRROR | JXH42_V_FLIP},
                {SGKS_VI_SENSOR_TABLE_FLAG_END,},
            },
            [SGKS_VI_SRC_MIRROR_VERTICALLY] =
            {
                {0x12, JXH42_V_FLIP, JXH42_H_MIRROR | JXH42_V_FLIP},
                {SGKS_VI_SENSOR_TABLE_FLAG_END,},
            },
            [SGKS_VI_SRC_MIRROR_NONE] =
            {
                {0x12, 0x00, JXH42_H_MIRROR | JXH42_V_FLIP},
                {SGKS_VI_SENSOR_TABLE_FLAG_END,},
            },
        },
    },

/*
 **********************************************************
 * Part exposure
 **********************************************************
 */
    .ExposurePart =
    {
        .def_sh_time    = SGKS_VIDEO_FPS(25),

        .h_pclk_ref     = SGKS_SENSOR_H_PCLK,
        .v_line_ref     = SGKS_SENSOR_V_LINE,
        .cal_shs_mode   = SGKS_SENSOR_CAL_SHS_VMAX_MODE,
        .shs_fix        = 0,

        .shs_reg_update_mode        = SGKS_SENSOR_UPDATE_REG_BY_SET,
        .agc_reg_update_mode        = SGKS_SENSOR_UPDATE_REG_BY_SET,
        .vmax_reg_update_mode       = SGKS_SENSOR_UPDATE_REG_BY_SET,

        .shs_additional_use         = 0,
        .shs_additional_percent     = 0,
        // hmax = (FRAMEW_H & 0x3F) << 8 +
        //        (FRAMEW_L & 0xFF) << 0
        .hmax_reg =
        {
            {0x21, 0x00, 0xFF, 0x00, 0x08, 0}, // FRAMEW_H
            {0x20, 0x00, 0xFF, 0x00, 0x00, 0}, // FRAMEW_L
            {SGKS_VI_SENSOR_TABLE_FLAG_END,},
        },
        // vmax = (FRAMEH_H & 0xFF) << 8 +
        //        (FRAMEH_L & 0xFF) << 0
        .vmax_reg =
        {
            {0x23, 0x00, 0xFF, 0x00, 0x08, 0}, // FRAMEH_H
            {0x22, 0x00, 0xFF, 0x00, 0x00, 0}, // FRAMEH_L
            {SGKS_VI_SENSOR_TABLE_FLAG_END,},
        },
        .vmax_wadd_reg = {SGKS_VI_SENSOR_TABLE_FLAG_END,},
        // shs = (EXP_H & 0xFF) << 8 +
        //       (EXP_L & 0xFF) << 0
        .shs_reg =
        {
            {0x02, 0x00, 0xFF, 0x00, 0x08, 0}, // EXP_H
            {0x01, 0x00, 0xFF, 0x00, 0x00, 0}, // EXP_L
            {SGKS_VI_SENSOR_TABLE_FLAG_END,},
        },
        .shs_additional_reg = {SGKS_VI_SENSOR_TABLE_FLAG_END,},

        .cal_gain_mode   = SGKS_SENSOR_CAL_GAIN_MODE1,
        .max_agc_index   = 80,
        .max_again_index = 0,
        .cur_again_index = 0,
        .agc_info =
        {
            .db_max     = 0x1db9a541,   // 15.5dB*4 max_db<<24
            .db_min     = 0x01000000,   // 1dB
            .db_step    = 0x00100000,   // 0.0625dB
        },
        .gain_reg =
        {
            {0x00, 0x00},
            {0x0D, 0x00},
            {SGKS_VI_SENSOR_TABLE_FLAG_END,},
        },
        .gain_table =
        {
            {0x00000000, {0x00, 0x50}}, //0.000000
            {0x008657c9, {0x01, 0x50}}, //0.524777
            {0x0105013a, {0x02, 0x50}}, //1.019550
            {0x017cd110, {0x03, 0x50}}, //1.487565
            {0x01ee7b47, {0x04, 0x50}}, //1.931569
            {0x025a997c, {0x05, 0x50}}, //2.353905
            {0x02c1afdd, {0x06, 0x50}}, //2.756590
            {0x032430f0, {0x07, 0x50}}, //3.141372
            {0x0382809d, {0x08, 0x50}}, //3.509775
            {0x03dcf68e, {0x09, 0x50}}, //3.863137
            {0x0433e01a, {0x0a, 0x50}}, //4.202638
            {0x048781d8, {0x0b, 0x50}}, //4.529325
            {0x04d818df, {0x0c, 0x50}}, //4.844130
            {0x0525dbda, {0x0d, 0x50}}, //5.147886
            {0x0570fbe4, {0x0e, 0x50}}, //5.441344
            {0x05b9a541, {0x0f, 0x50}}, //5.725178
            {0x06000000, {0x10, 0x50}}, //6.000000
            {0x068657c9, {0x11, 0x50}}, //6.524777
            {0x0705013a, {0x12, 0x50}}, //7.019550
            {0x077cd110, {0x13, 0x50}}, //7.487565
            {0x07ee7b47, {0x14, 0x50}}, //7.931569
            {0x085a997c, {0x15, 0x50}}, //8.353905
            {0x08c1afdd, {0x16, 0x50}}, //8.756590
            {0x092430f0, {0x17, 0x50}}, //9.141372
            {0x0982809d, {0x18, 0x50}}, //9.509775
            {0x09dcf68e, {0x19, 0x50}}, //9.863137
            {0x0a33e01a, {0x1a, 0x50}}, //10.202638
            {0x0a8781d8, {0x1b, 0x50}}, //10.529325
            {0x0ad818df, {0x1c, 0x50}}, //10.844130
            {0x0b25dbda, {0x1d, 0x50}}, //11.147886
            {0x0b70fbe4, {0x1e, 0x50}}, //11.441344
            {0x0bb9a541, {0x1f, 0x50}}, //11.725178
            {0x0c000000, {0x20, 0x50}}, //12.000000
            {0x0c8657c9, {0x21, 0x50}}, //12.524777
            {0x0d05013a, {0x22, 0x50}}, //13.019550
            {0x0d7cd110, {0x23, 0x50}}, //13.487565
            {0x0dee7b47, {0x24, 0x50}}, //13.931569
            {0x0e5a997c, {0x25, 0x50}}, //14.353905
            {0x0ec1afdd, {0x26, 0x50}}, //14.756590
            {0x0f2430f0, {0x27, 0x50}}, //15.141372
            {0x0f82809d, {0x28, 0x50}}, //15.509775
            {0x0fdcf68e, {0x29, 0x50}}, //15.863137
            {0x1033e01a, {0x2a, 0x50}}, //16.202638
            {0x108781d8, {0x2b, 0x50}}, //16.529325
            {0x10d818df, {0x2c, 0x50}}, //16.844130
            {0x1125dbda, {0x2d, 0x50}}, //17.147886
            {0x1170fbe4, {0x2e, 0x50}}, //17.441344
            {0x11b9a541, {0x2f, 0x50}}, //17.725178
            {0x12000000, {0x30, 0x50}}, //18.000000
            {0x128657c9, {0x31, 0x50}}, //18.524777
            {0x1305013a, {0x32, 0x50}}, //19.019550
            {0x137cd110, {0x33, 0x50}}, //19.487565
            {0x13ee7b47, {0x34, 0x50}}, //19.931569
            {0x145a997c, {0x35, 0x50}}, //20.353905
            {0x14c1afdd, {0x36, 0x50}}, //20.756590
            {0x152430f0, {0x37, 0x50}}, //21.141372
            {0x1582809d, {0x38, 0x50}}, //21.509775
            {0x15dcf68e, {0x39, 0x50}}, //21.863137
            {0x1633e01a, {0x3a, 0x50}}, //22.202638
            {0x168781d8, {0x3b, 0x50}}, //22.529325
            {0x16d818df, {0x3c, 0x50}}, //22.844130
            {0x1725dbda, {0x3d, 0x50}}, //23.147886
            {0x1770fbe4, {0x3e, 0x50}}, //23.441344
            {0x17b9a541, {0x3f, 0x50}}, //23.725178
            {0x18000000, {0x30, 0x51}}, //24.000000
            {0x188657c9, {0x31, 0x51}}, //24.524777
            {0x1905013a, {0x32, 0x51}}, //25.019550
            {0x197cd110, {0x33, 0x51}}, //25.487565
            {0x19ee7b47, {0x34, 0x51}}, //25.931569
            {0x1a5a997c, {0x35, 0x51}}, //26.353905
            {0x1ac1afdd, {0x36, 0x51}}, //26.756590
            {0x1b2430f0, {0x37, 0x51}}, //27.141372
            {0x1b82809d, {0x38, 0x51}}, //27.509775
            {0x1bdcf68e, {0x39, 0x51}}, //27.863137
            {0x1c33e01a, {0x3a, 0x51}}, //28.202638
            {0x1c8781d8, {0x3b, 0x51}}, //28.529325
            {0x1cd818df, {0x3c, 0x51}}, //28.844130
            {0x1d25dbda, {0x3d, 0x51}}, //29.147886
            {0x1d70fbe4, {0x3e, 0x51}}, //29.441344
            {0x1db9a541, {0x3f, 0x51}}, //29.725178
        },
    },
};

